package com.vito.oa.act.extend.action;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.dubbo.config.annotation.Reference;
import com.sun.star.setup.BaseAction;
import com.vito.act.model.ActExBussDefModel;
import com.vito.base.model.Result;
import com.vito.oa.act.extend.model.OaActExBussDefModel;
import com.vito.oa.act.extend.service.OaActExBussDefService;
@Controller
@RequestMapping("oa/act/actExBussDef")
public class OaActExBussDefAction extends BaseAction {
	private static final Logger log = LoggerFactory.getLogger(OaActExBussDefAction.class);
	@Reference
	private OaActExBussDefService oaActExBussDefService;
	
	@RequestMapping("queryActAllBussDef")
	@ResponseBody
	public Result queryActExBussDefByPage(ActExBussDefModel actExBussDefModel){
		Result rs = new Result();
		try{
			rs.setData(oaActExBussDefService.queryActAllBussDef(actExBussDefModel));
			rs.setCode(Result.CODE_OK);
		}catch(Exception e){
			log.error("添加异常：",e);
			rs.setCode(Result.CODE_ERROR);
		}
		return rs;
	}
	
	@RequestMapping("updateActEExBussDef")
	@ResponseBody
	public Result updateActEExBussDef(OaActExBussDefModel actExBussDefModel){
		Result rs = new Result();
		try{
			oaActExBussDefService.updateActEExBussDef(actExBussDefModel);
			rs.setCode(Result.CODE_OK);
		}catch(Exception e){
			log.error("添加异常：",e);
			rs.setCode(Result.CODE_ERROR);
		}
		return rs;
	}
}



